package pers.wj.springcloud.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pers.wj.springcloud.entities.Employee;
import pers.wj.springcloud.service.ClientService;

import java.util.List;

/**
 * feign
 *
 * @author wangjie
 * @version V1.0
 * @date 2020/2/28
 */
@RestController
public class FeignConsumerController
{
	@Autowired
	private ClientService service;

	@RequestMapping(value = "/consumer/feign/get/{id}")
	public Employee get(@PathVariable("id") Long id)
	{
		return this.service.get(id);
	}

	@RequestMapping(value = "/consumer/feign/list")
	public List<Employee> list()
	{
		return this.service.list();
	}

	@RequestMapping(value = "/consumer/feign/add")
	public Object add(Employee dept)
	{
		return this.service.add(dept);
	}
}
